package com.company.project.common.pojo;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

public class Rest<T> implements Serializable{

    private static final long serialVersionUID = 5952861126789622536L;

    @ApiModelProperty(value="状态码：【｛200：操作成功｝，｛400：参数错误｝，｛401：用户认证失败｝，｛403：服务器不处理｝，｛500：服务器错误｝】")
    private String code;
    @ApiModelProperty(value="描述")
    private String desc;
    @ApiModelProperty(value="数据")
    private T data;


    public Rest() {
        super();
    }

    public Rest(String code) {
        super();
        this.code = code;
    }

    public Rest(String code, String desc) {
        super();
        this.code = code;
        this.desc = desc;
    }

    public Rest(String code, String desc, T result) {
        super();
        this.code = code;
        this.desc = desc;
        this.data = result;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        desc = desc == null ? "无回复说明！" : desc;
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}

	
